﻿using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using Padsurface.App.ViewModels.Start;
using System.Collections.Generic;

namespace Padsurface.App.Tests.Unit.ViewModels.StartViewModelSpecifications
{
    public abstract class WhenLoad : StartViewModelTestBase
    {
        protected override void Act()
        {
            ViewModel.Load();
        }
    }

    [TestClass]
    public class WhenLoadGivenNoRecentSongs : WhenLoad
    {
        protected override void Arrange()
        {
            base.Arrange();
            RecentSongCache.LoadResult = new List<SongProjectViewModel>();
        }

        [TestMethod]
        public void ThenRecentSongsShouldBeEmpty()
        {
            Assert.AreEqual(0, ViewModel.RecentSongs.Count);
        }
    }

    [TestClass]
    public class WhenLoadGivenOneRecentSong : WhenLoad
    {
        protected override void Arrange()
        {
            base.Arrange();
            RecentSongCache.LoadResult = new List<SongProjectViewModel> { new SongProjectViewModel(@"c:\dummy.dummy") };
        }

        [TestMethod]
        public void ThenThereShouldBeOneRecentSongLoaded()
        {
            Assert.AreEqual(1, ViewModel.RecentSongs.Count);
        }
    }
}
